<template>
	<div class="info_wrapper">
    <div v-if="headIos" style="width: 100%; height: 20px;background: white;position: fixed;top: 0;"></div>
		<k-header headTitle="我的消息" goBack="true"></k-header>
		<ul :class="headIos?'side-fixd-ios':'side-fixed'">
			<li class="item clearfix" v-for="inforlist in list" :key="inforlist.id" @click="thisdetail(inforlist.id)">
				<div class="item_info clearFix">
					<div class="item_info_system">系统消息</div>
					<div class="item_info_data">{{ inforlist.createTime }}</div>
				</div>
				<div class="item_text">{{ inforlist.messageInfo.title }}</div>
			</li>
		</ul>
	</div>
</template>

<script>
	import kHeader from '../common/head'
	import util from '../../libs/util'
	export default {

		data(){
      return {
				list:'',
				headIos: false
      }
    },
		components:{
			kHeader
		},
		methods: {
			getlist() {
				let that = this;
				let url = 'lblsapp-h5/v2/index/queryMessageInfo.json';
				let datas = {};
				datas.memberId = this.$route.query.bp;
				util.ajax.post(url, datas).then(function(stats){
					console.log(stats);
					that.list = stats.data.res.data.result;
				}).catch(function(error){
					console.log(error);
				})
			},
			thisdetail(g) {
				this.$router.push({path: '/mydetail', query: { num: g } });
			}
		},
		created() {
			if (window.navigator.userAgent.indexOf('LBLSIOS') > -1) {
				this.headIos = true;
			}
			this.getlist();
		}
	}
</script>

<style scoped>
	.clearfix:after{
		display: block;
		height: 0;
		clear: both;
		overflow: hidden;
		visibility: hidden;
		content: '';
	}
	.info_wrapper{
	    height: 100%;
    	box-sizing: border-box;
        background: rgb(245,245,245);
    	padding-top: 45px;
	}
	.item{
	    height: 90px;
	    width: 100%;
	    padding: 3px 15px;
	    box-sizing: border-box;
	    background: #FFFFFF;
	    display: block;
	    border-top: 10px solid rgb(245,245,245);
	}
	.side-fixd-ios {
		margin-top: 20px;
	}
	.item_info{
		width: 100%;
		height: 30px;
		line-height: 29px;
		font-size: 1.2rem;
		color: #808080;
		border-bottom: 1px solid rgb(245,245,245);
	}
	.item_info_system{
		float: left;
	}
	.item_info_data{
		float: right;
	}
	.item_text{
		height: 44px;
		width: 100%;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		font-size: 1.4rem;
		line-height: 44px;
	}
</style>
